package com.k.mclock.util

import java.util.Calendar

object CommonUtil {
    fun getCurrentHour(): Int {
        return Calendar.getInstance().get(Calendar.HOUR_OF_DAY)
    }

    fun getCurrentMinute(): Int {
        return Calendar.getInstance().get(Calendar.MINUTE)
    }

    fun getCurrentSecond(): Int {
        return Calendar.getInstance().get(Calendar.SECOND)
    }

    fun getCurrentTime24HourFormat(): String {
        val calendar = Calendar.getInstance()
        return String.format(
            "%02d:%02d:%02d",
            calendar[Calendar.HOUR_OF_DAY],
            calendar[Calendar.MINUTE],
            calendar[Calendar.SECOND]
        )
    }
}